package com.handinfo.android.game.item;

import android.graphics.Bitmap;

import com.handinfo.android.DWGameManager;
import com.handinfo.android.game.Attribute;
import com.handinfo.android.game.Role;

public class ItemEquipment extends Item
{
	//品阶
	private static final String 品阶_1_10 = "凡器";
	private static final String 品阶_11_20 = "宝器";
	private static final String 品阶_21_30 = "灵器";
	private static final String 品阶_31_40 = "仙器";
	private static final String 品阶_41_50 = "神器";
	private static final String 品阶_51_60 = "圣器";
	private static final String 品阶_61_70 = "天圣器";

	public static final byte 强化最大等级 = 50;

	public int m_gs;//装备评分 品阶
	public int[] m_attrValue;//属性值
	public int[] m_attrAddValue;//属性增加值
	public int[] m_attrAddValus_forge;//追加道具锻造属性
	public short m_strengthenLevel;//当前强化等级
	public short m_maxStrengthenLevel;//最大强化等级
	public short m_maxDurable;//装备最大耐久
	public short m_nowDurable;//装备当前耐久
	public short[] m_iconidGem;//宝石Icon
	public short m_nowStrengthenSpiritNeedAmount;//当前强化精魂需求数目
	public byte m_equipAnimationSize;//装备动画资源数目<根据装备位确定数目>
	public byte m_equipAttrSize;//属性列表大小，默认19
	public byte m_equipGemsSize;//装备宝石槽数目;
	public byte m_equip_Index;//装备位索引
	public byte[] m_hasGem;//是否有宝石
	public String m_suitKey;//所属套装key
	public String m_product_order;//品阶描述
	public String[] m_anim_url;//动画url
	public String[] m_nameGem;//宝石名字
	public String[] m_GemData;//装备内的宝石增加属性描述
	public Bitmap[] m_gemIcon;//宝石大图标
	public Bitmap[] m_gemSamllIcon;//宝石小图标
	public byte m_attrLv;//装备星级

	/**
	 * 返回宝石属性描述
	 * */
	public String getGemDatas(int index)
	{
		String temp = null;
		switch (index) {
			case 0://红 -力
				temp = "+" + m_attrAddValue[Attribute.力] + "力量";
				break;
			case 1://蓝 -智
				temp = "+" + m_attrAddValue[Attribute.智] + "智力";
				break;
			case 2://绿 -技
				temp = "+" + m_attrAddValue[Attribute.技] + "技巧";
				break;
			case 3://黄 -敏
				temp = "+" + m_attrAddValue[Attribute.敏] + "敏捷";
				break;
			default:
				temp = "未镶嵌";
				break;
		}
		return temp;
	}

	/**
	 * 返回对应品阶
	 * */
	public String getProductOrder(short num)
	{
		String n = "";
		if (num <= 0) {
			return n;
		}
		else if (num > 0 && num < 11) {
			n = 品阶_1_10;
		}
		else if (num > 10 && num < 21) {
			n = 品阶_11_20;
			num -= 10;
		}
		else if (num > 20 && num < 31) {
			n = 品阶_21_30;
			num -= 20;
		}
		else if (num > 30 && num < 41) {
			n = 品阶_31_40;
			num -= 30;
		}
		else if (num > 40 && num < 51) {
			n = 品阶_41_50;
			num -= 40;
		}
		else if (num > 50 && num < 61) {
			n = 品阶_51_60;
			num -= 50;
		}
		else if (num > 60 && num < 71) {
			n = 品阶_61_70;
			num -= 60;
		}
		return n.concat(Integer.toString(num)).concat("阶");
	}
	
	public boolean doShortcutAction()
	{
		if (m_equip_Index == ItemConstants.装备_坐骑) {
			DWGameManager.getInstance().m_role.oneKeyUseRide(this);
		}
		return true;
	}

	public boolean doShortcutAction(Role role)
	{
		return true;
	}
}
